package qianFeng.day1;

import java.util.Scanner;

public class text {
    public static int ti_xue=100;
    public static int wang_qiu_xie=199;
    public static int wang_qiu_pai=138;

    public static int switch_triage;
    public static String contral="y";
    public static void main(String[] args) {
        int quantity;
        Scanner input=new Scanner(System.in);

        while (contral.equals("y")){
            System.out.println("--------------------------------------");
            System.out.println("请选择购买的商品：");
            System.out.println("1.T桖    2.网球鞋    3.网球拍");
            System.out.print("请输入商品编号：");
            switch_triage=input.nextInt();
            System.out.print("请输入商品数量：");
            quantity=input.nextInt();
           shapping(switch_triage,quantity);
           System.out.println("是否继续购买(y/n)：");
           contral= input.next();
           if (contral.equals("n")) {
               System.out.println("程序已结束！");
               break;
           }
        }


    }
    public static void shapping(int x,int quantity){
        switch (x){
            case 1:
                System.out.println("T桖"+quantity+"件   合计："+ti_xue*quantity+"元人命币。");
                break;
            case 2:
                System.out.println("网球鞋"+quantity+"件   合计："+wang_qiu_xie*quantity+"元人命币。");
                break;
            case 3:
                System.out.println("网球拍"+quantity+"件   合计："+wang_qiu_pai*quantity+"元人命币。");
                break;
            default:
                System.out.println("输入格式有误！");
        }
    }
}
